import axios from 'axios'
async function urlToFile(url) {
  // 获取图片的二进制数据
  const response = await axios.get(url, {
    responseType: 'arraybuffer'
  })

  // 从URL中提取文件名
  const parts = url.split('/')
  const filename = parts[parts.length - 1]

  // 创建Blob对象
  const blob = new Blob([response.data], { type: response.headers['content-type'] })

  // 创建File对象
  const file = new File([blob], filename)

  return file
}